package org.numb.service;

import org.numb.model.User;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class UserService {
    private final Map<String, String> userMap = new HashMap<String, String>(){{
        put("00112233", "Zhang San");
        put("00112234", "Yan Si");
    }};

    public String getUserName(String userId) {
        return userMap.get(userId);
    }

    public User getUser(String userId) {
        String userName =  getUserName(userId);
        User user = new User();
        user.setId(userId);
        user.setName(userName);
        return user;
    }
}
